﻿@model MembershipUserCollection
@{
    ViewBag.Title = "Index";
}
<h2>用户列表</h2>
@Html.ActionLink("新建", "Create")
<table>
    <thead>
        <tr>
            <th>
                用户Id
            </th>
            <th>
                用户名
            </th>
            <th>
                Email
            </th>
            <th>
                是否有效
            </th>
            <th>
                是否锁定
            </th>
            <th>
                创建日期
            </th>
            <th>
                上次登录日期
            </th>
            <th>
                是否在线
            </th>
            <th>
                角色
            </th>
            <th>
                操作
            </th>
        </tr>
    </thead>
    @foreach (MembershipUser user in Model) { 
        <tbody>
            <tr>
                <td>
                    @user.ProviderUserKey
                </td>
                <td>
                    @user.UserName
                </td>
                <td>
                    @user.Email
                </td>
                <td>
                    @user.IsApproved
                </td>
                <td>
                    @user.IsLockedOut
                </td>
                <td>
                    @user.CreationDate
                </td>
                <td>
                    @user.LastLoginDate
                </td>
                <td>
                    @user.IsOnline
                </td>
                <td>
                    @{string[] roles = Roles.GetRolesForUser(user.UserName);}                    
                    @foreach (string role in roles) {
                        @string.Format("{0},", role);
                    }
                </td>
                <td>
                     @Html.ActionLink("查看详细", "Index","KSPUser", new { userName = user.UserName }, null)
                </td>
            </tr>
        </tbody>
    }
</table>
@Html.ActionLink("主页", "Index","KSP")